#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int sum(int n);
int main()
{
    int x;
    while(scanf("%d",&x)!=EOF)
    {
      printf("%d\n",sum(x));
    }
    return 0;
}
int sum(int x)
{
	int k=0,p=0;
	while(x!=0)
	{
	   k=x%10;
	   k=p*10+k;
	   x=x/10;
	   p=k;
	}
	return k;
}